<h1>Add A Class</h1>
<div>
	<form action="<?php echo site_url('admin/manage_classes'); ?>" method="POST">

		<label for="tutor_id">Select the Class's Tutor:</label>
		<select name="tutor_id" id="tutor_id">
			<?php foreach ($tutors as $tutor) : ?>
				<option value="<?php echo $tutor['user_id']; ?>"><?php echo $tutor['first_name'] . ' ' . $tutor['last_name']; ?></option>
			<?php endforeach; ?>
		</select>

		<br>

		<label for="location">Class Location:</label>
		<input type="text" name="location">

		<br>

		<label for="day">Day:</label>
		<select name="day" id="day">
				<option value="monday">Monday</option>
				<option value="tuesday">Tuesday</option>
				<option value="wednesday">Wednesday</option>
				<option value="thursday">Thursday</option>
				<option value="friday">Friday</option>
				<option value="saturday">Saturday</option>
				<option value="sunday">Sunday</option>
		</select>

		<br>

		<label for="start_time">Class Time:</label>
		From <input type="text" name="start_time" id="timepicker_start" style="width:100px;">
		Until <input type="text" name="end_time" id="timepicker_end" style="width:100px;" >

		<br>
		
		<input type="submit" value="Add Class">

	</form>
</div>

<div class="clear"></div>

<h1>View Classes</h1>
<div>

<table>
	
	<tr>
		<th>Tutor ID</th>
		<th>Location</th>
		<th>Day</th>
		<th>Start Time</th>
		<th>End Time</th>
		<th>Delete Class</th>
	</tr>

	<?php if ( is_array($classes) ) : ?>
	<?php foreach ($classes as $class_data) : ?>
		<tr>
			<td><?php echo $class_data['tutor_id']; ?></td>
			<td><?php echo $class_data['location']; ?></td>
			<td><?php echo ucfirst( $class_data['day'] ); ?></td>
			<td><?php echo $class_data['start_time']; ?></td>
			<td><?php echo $class_data['end_time']; ?></td>
			<td><a href="<?php echo site_url('admin/manage_classes'); ?>/delete/<?php echo $class_data['class_id']; ?>">Delete Class</a></td>
		</tr>
	<?php endforeach ?>
	<?php else : ?>
	<p>No classes have been added yet, please create one above.</p>
	<?php endif; ?>

</table>
	
</div>
